{extend name="../front" /}
{block name="head"}
<title>{$title}－{:config('site.title')}</title>
<meta name="keywords" content="{$keywords}" />
<meta name="description" content="{$description}" />
<meta name="referrer" content="never">
{/block}
{block name="main"}
<main class="container">
  <div class="card mb-3">
    <div class="card-body">
      <h5 class="card-title fw-bold">{$title}</h5>
      <p class="card-text text-muted">
        {$description}<a class="fw-bold ms-1" id="btn-test" href="javascript:;" data-target="#post-text" data-content="抖音去水印演示 https://v.douyin.com/isVFMGW/">测试链接</a>
      </p>
      <form class="row g-3 mb-0" action="{:dcUrl('index/parse/save')}" id="parse" method="post" target="_blank">
        <input type="hidden" name="post[id]" value="{$id}">
        {volist name="fields" id="item"}
        <div class="{$item.class|default='col-12'}">
          <textarea class="form-control fs-0" rows="{$item.rows|default=3}" name="post[{$key}]" id="post-{$key}" placeholder="{$item.tips}" required>{$item.value}</textarea>
        </div>
        {/volist}
        <div class="col-auto">
          <button type="button" class="btn btn-sm btn-secondary btn-trash me-3" data-target=".form-control">清空内容</button>
          <button type="submit" class="btn btn-sm btn-primary me-3">开始解析<i class="iconfont icon-loading hidden fs-0 ms-1"></i></button>
          {if $score}<span class="text-muted small">{$score}个积分/次</span>{/if}
        </div>
      </form>
    </div>
  </div>
  <section class="hidden" id="result">
    <div class="alert alert-dark mb-3 fw-bold" id="desc">视频标题</div>
    <div class="card mb-3">
      <div class="card-body">
        <h6 class="card-title fw-bold"><i class="iconfont icon-play me-1"></i>视频下载地址</h6>
        <p class="card-text text-muted fs-0 mb-1">下载页面打开后（鼠标右键点击－选择另存为）即可下载无水印视频</p>
        <p class="card-text"><textarea class="form-control fs-0" rows="5" id="video"></textarea></p>
        <p class="card-text">
          <button class="btn btn-sm btn-secondary btn-copy me-3" type="button" data-clipboard-action="copy" data-clipboard-target="#video">复制视频链接</button>
          <a class="btn btn-sm btn-primary" id="btn-video" href="javascript:;" target="_blank" data-target="#video">解析成功（点击下载）</a>
        </p>
      </div>
    </div>
    <div class="card">
      <div class="card-body">
        <h6 class="card-title fw-bold"><i class="iconfont icon-music me-1"></i>音频下载地址</h6>
        <p class="card-text text-muted fs-0 mb-1">下载页面打开后（鼠标右键点击－选择另存为）即可下载音频MP3</p>
        <p class="card-text">
          <textarea class="form-control fs-0" rows="3" id="audio"></textarea>
        </p>
        <p class="card-text">
          <button class="btn btn-sm btn-secondary btn-copy me-3" type="button" data-clipboard-action="copy" data-clipboard-target="#audio">复制音频链接</button>
          <a class="btn btn-sm btn-primary" id="btn-audio" href="javascript:;" target="_blank" data-target="#audio">解析成功（点击下载）</a>
        </p>
      </div>
    </div>
  </section>
</main>
{/block}